package com.scujj.cs6.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.scujj.cs6.model.vo.WeatherForecastVo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.time.LocalDate;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class WeatherForecastWithCities {
    @TableId(value = "id")
    private Long id;
    @TableField(value = "province")
    private String province;
    @TableField(value = "city")
    private String city;
    @TableField(value = "adcode")
    private String adcode;
    @TableField(value = "date")
    private LocalDate date;
    @TableField(value = "week")
    private String week;
    @TableField(value = "text_day")
    private String textDay;
    @TableField(value = "text_night")
    private String textNight;
    @TableField(value = "high")
    private Integer high;
    @TableField(value = "low")
    private Integer low;
    @TableField(value = "wc_day")
    private String wcDay;
    @TableField(value = "wc_night")
    private String wcNight;
    @TableField(value = "wd_day")
    private String wdDay;
    @TableField(value = "wd_night")
    private String wdNight;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public WeatherForecastWithCities(WeatherForecastVo weatherForecastVo) {
        BeanUtils.copyProperties(weatherForecastVo, this);
    }

    public WeatherForecastWithCities(WeatherForecast weatherForecast) {
        BeanUtils.copyProperties(weatherForecast, this);
    }
}
